//
//  SongCollectionViewCell.m
//  212--Homework  QQy音乐  阿里星球
//
//  Created by 冀永金 on 16/8/13.
//  Copyright © 2016年 冀永金. All rights reserved.
//

#import "SongCollectionViewCell.h"
#import "ThirdModel.h"
@interface SongCollectionViewCell ()
@property (nonatomic, strong) UILabel *nameLabel;
@property (nonatomic, strong) UILabel *descLabel;
@property (nonatomic, strong) UIImageView *image;
@end
@implementation SongCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    return self;
}
- (void)createView {
    self.nameLabel = [[UILabel alloc]init];
    [self.contentView addSubview:_nameLabel];
    self.nameLabel.textColor = [UIColor whiteColor];
    self.nameLabel.font = [UIFont systemFontOfSize:18];
    //_nameLabel.backgroundColor = [UIColor redColor];
    self.descLabel = [[UILabel alloc]init];
    self.descLabel.textColor = [UIColor whiteColor];
    [self.contentView addSubview:_descLabel];
    self.descLabel.font = [UIFont systemFontOfSize:15];
    //_descLabel.backgroundColor = [UIColor yellowColor];
    self.image = [[UIImageView alloc]init];
    //_image.backgroundColor = [UIColor cyanColor];
    [self.contentView addSubview:_image];
    _image.image = [UIImage imageNamed:@"bofang"];
    _image.layer.cornerRadius = 15;
    _image.clipsToBounds = YES;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.nameLabel.frame = CGRectMake(5, 25, 80, 30);
    self.descLabel.frame = CGRectMake(5, 60, 130, 25);
    self.image.frame = CGRectMake(self.bounds.size.width -40, 45, 30, 30);
}
- (void)setThird:(ThirdModel *)third {
    _third = third;
    self.nameLabel.text = third.name;
    self.descLabel.text = third.desc;
}


@end
